﻿<%@ Page Language="C#" MasterPageFile="~/MainMaster.Master" AutoEventWireup="true"
    CodeBehind="KtCommCodeList.aspx.cs" Inherits="Mang24k99.Web.COMM.KtCommCodeList"
    Title="系统共用代码表维护" %>

<%@ Register Assembly="AspNetPager" Namespace="Wuqi.Webdiyer" TagPrefix="webdiyer" %>
<asp:Content ID="Content1" ContentPlaceHolderID="head" runat="server">
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="ContentPlaceHolder1" runat="server">
      <script type="text/javascript">
         function Cancel()
        {
            var result =confirm("刚才未保存的操作将会取消，你确定吗？");
            if(result)
            {
                return true;
            }
            else
            {
                return false;
            }
        }
        function search(e)
        {
            if (e.keyCode==13)
            {
                var btn=document.getElementById(<%="'"+this.btnSearch.ClientID+"'" %>);
                btn.click();
            }
            
        }
    </script>
    
    <div>
        <asp:Panel ID="Panel1" runat="server">
            <asp:Button ID="btnBack" CssClass="form_btn" runat="server" Text="返回上一页" 
                onclick="btnBack_Click" UseSubmitBehavior="False" />
            <table class="tb_table2">
                <tr>
                    <td class="tb_title1">
                        代码编码：
                    </td>
                    <td class="tb_txt1">
                        <asp:TextBox ID="txtcode" runat="server"></asp:TextBox>
                    </td>
                    <td class="tb_title1">
                        中文名称：
                    </td>
                    <td class="tb_txt1">
                        <asp:TextBox ID="txtCName" runat="server"></asp:TextBox>
                    </td>
                </tr>
                <tr>
                    <td class="tb_title1">
                        英文名称：
                    </td>
                    <td class="tb_txt1">
                        <asp:TextBox ID="txtEName" runat="server"></asp:TextBox>
                    </td>
                    <td class="tb_title1">
                        是否有效：
                    </td>
                    <td class="tb_txt1">
                        <asp:DropDownList ID="ddlIsValidate" runat="server">
                            <asp:ListItem Selected="True" Value="1">使用</asp:ListItem>
                            <asp:ListItem Value="0">禁用</asp:ListItem>
                        </asp:DropDownList>
                    </td>
                </tr>
                <tr>
                    <td class="tb_title1" valign="top">
                        代码类型：
                    </td>
                    <td class="tb_txt1" valign="top">
                        <span>
                            <asp:DropDownList ID="ddlTypecode" runat="server">
                            </asp:DropDownList>
                        </span>
                    </td>
                    <td class="tb_title1" valign="top">
                        备&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;注：
                    </td>
                    <td class="tb_txt1" valign="top">
                        <asp:TextBox ID="txtRemark" runat="server" Height="80px" TextMode="MultiLine"></asp:TextBox>
                    </td>
                </tr>
                <tr>
                    <td align="center" colspan="2">
                        <asp:Button ID="btnSave" CssClass="form_btn" runat="server" Text="保存" 
                            onclick="btnSave_Click" UseSubmitBehavior="False" />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
                        <asp:Button ID="btnCancel" CssClass="form_btn" runat="server" Text="取消" 
                            OnClientClick="return Cancel()" OnClick="btnCancel_Click" />
                    </td>
                </tr>
            </table>
        </asp:Panel>
        <asp:Panel ID="Panel2" runat="server" EnableTheming="True">
            <div>
                <asp:Button ID="btnAdd" CssClass="form_btn" runat="server" Text="新增" 
                    onclick="btnAdd_Click" UseSubmitBehavior="False" />
            </div>
            <div>
                <table>
                    <tr>
                        <td class="tb_searchTitle1">
                            代码类型：
                        </td>
                        <td class="tb_searchTxt1">
                            <asp:TextBox ID="txtTypeCode" runat="server" onkeydown="search(event)"></asp:TextBox>
                        </td>
                        <td class="form_btn">
                            <asp:Button ID="btnSearch" CssClass="form_btn" runat="server" Text="查询" 
                                onclick="btnSearch_Click" />
                        </td>
                    </tr>
                </table>
            </div>
            <div>
                <asp:GridView  ID="grdList" runat="server" OnSelectedIndexChanged="grdList_SelectedIndexChanged"
                     Width="100%" OnRowDeleting="grdList_RowDeleting" AutoGenerateColumns="False">
                    <HeaderStyle CssClass="tb_title2" />
                    <RowStyle CssClass="tb_txt2" />
                     <Columns>
                        <asp:TemplateField HeaderText="序号">
                            <ItemTemplate>
                                <%#Container.DataItemIndex+1%>
                            </ItemTemplate>
                        </asp:TemplateField>
                        <asp:BoundField DataField="ID" HeaderText="ID" Visible="true" />
                        <asp:BoundField DataField="CODE_NO" HeaderText="代码编号" />
                        <asp:BoundField DataField="CODE_CNAME" HeaderText="中文名称" />
                        <asp:BoundField DataField="CODE_ENAME" HeaderText="英文名称" />
                        <asp:TemplateField HeaderText="代码类型">
                            <ItemTemplate>
                                <asp:Label ID="labtype" runat="server" Text='<%#GetTypeName((int)Eval("MKtCommCodeType.TYPE_CODE"))%>'></asp:Label>
                            </ItemTemplate>
                        </asp:TemplateField>
                        <asp:TemplateField HeaderText="是否有效">
                            <ItemTemplate>
                                <asp:Label ID="lab" runat="server" Text='<%#GetStatus((int)Eval("IS_VALIDATE"))%>'></asp:Label>
                            </ItemTemplate>
                        </asp:TemplateField>
                        <asp:BoundField DataField="CODE_COMMENTS" HeaderText="备注" />
                        <asp:ButtonField ButtonType="link" CommandName="Select" HeaderText="编辑" ShowHeader="True"
                            Text="编辑" />
                        <asp:CommandField DeleteText="&lt;div id=&quot;de&quot; onclick=&quot;JavaScript:return confirm('确定删除吗？')&quot;&gt;删除&lt;/div&gt; "  HeaderText="删除"
                            ShowDeleteButton="True" />
                    </Columns>
                </asp:GridView>
            </div>
            <div>
               <webdiyer:AspNetPager ID="AspNetPager1" runat="server" PageSize="8" FirstPageText="首页"
	                LastPageText="尾页" NextPageText="下一页" OnPageChanged="AspNetPager1_PageChanged"
	                PrevPageText="上一页" ShowInputBox="Always" SubmitButtonText="GO" AlwaysShow="True"
	                CssClass="AspNetPager" CustomInfoHTML="  共&lt;span class=&quot;AspNetPager_current&quot;&gt;{0}&lt;/span&gt;页"
	                CurrentPageButtonClass="AspNetPager_current"  CustomInfoClass="" HorizontalAlign="Right"
	                InputBoxClass="AspNetPager_txt" SubmitButtonClass="AspNetPager_btn" CurrentPageButtonStyle="AspNetPager"
	                PagingButtonSpacing="1px" ShowCustomInfoSection="Right" >
               </webdiyer:AspNetPager>
            </div>
        </asp:Panel>
    </div>
</asp:Content>
